From 415493aeed2765b2be2374813f7fab1e18e766e7 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Tue, 31 Dec 2013 06:06:44 +0000 Subject: [PATCH] Fix a test case error in gdb caused by excessive bogusness. I have No Idea why extra_data is involved in this path. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4671 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/gdb.cc | 5 ++++- gpsbabel/netstumbler.cc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gpsbabel/gdb.cc b/gpsbabel/gdb.cc index eb5268c55..f9dfdc01e 100644 --- a/gpsbabel/gdb.cc +++ b/gpsbabel/gdb.cc @@ -1828,7 +1828,10 @@ write_waypoint_cb(const waypoint* refpt) name = mkshort(short_h, name); #if NEW_STRINGS // This is sooooo tacky. - wpt->extra_data = static_cast(&name); + // Actually, it's not just tacky. I can't figure out what this code + // was trying to do, but it's wrong and it breaks things. + // robertl 2013-12-30. + // wpt->extra_data = static_cast(&name); #else wpt->extra_data = (void*)name; #endif diff --git a/gpsbabel/netstumbler.cc b/gpsbabel/netstumbler.cc index 577b32815..83e06a1e7 100644 --- a/gpsbabel/netstumbler.cc +++ b/gpsbabel/netstumbler.cc @@ -296,7 +296,6 @@ fix_netstumbler_dupes(void) int i, ct = waypt_count(), serial = 0; htable_t* htable, *bh; unsigned long last_crc; - char ssid[32 + 5 + 1]; htable = (htable_t*) xmalloc(ct * sizeof *htable); bh = htable; @@ -330,6 +329,7 @@ fix_netstumbler_dupes(void) #if NEW_STRINGS bh->wpt->shortname += QString("/%1").arg(++serial); #else + char ssid[32 + 5 + 1]; snprintf(ssid, sizeof ssid, "%s/%d", CSTRc(bh->wpt->shortname), ++serial); xfree(bh->wpt->shortname); bh->wpt->shortname = xstrdup(ssid); -- 2.30.2